﻿ALTER TABLE medianamik_Property ALTER COLUMN ValidationRegex nvarchar(1024)

-- Module de listes
-- SP
IF NOT EXISTS (SELECT NULL FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[medianamik_GetPagedNodesByType]') AND type in (N'P', N'PC'))
BEGIN
EXEC('CREATE PROCEDURE [dbo].[medianamik_GetPagedNodesByType]
	@TypeId UNIQUEIDENTIFIER,
	@PropertyId UNIQUEIDENTIFIER,
	@PageNumber INT,
	@PageSize INT,
	@Revision INT = NULL
AS
BEGIN

DECLARE @FirstRow INT
DECLARE @LastRow INT
SET @FirstRow = (@PageNumber - 1) * @PageSize + 1
SET @LastRow = @FirstRow + @PageSize - 1

;With Revisions AS (
	select npv2.NodeId, npv2.Value, MAX(ISNULL(Revision, dbo.fn_medianamik_MaxRevision())) as Revision,
		   ROW_NUMBER() OVER (ORDER BY npv2.Value) AS RowNumber, 
		   COUNT(*) OVER() AS c
		from medianamik_nodePropertyValue npv2
		inner join medianamik_NodeInstance ni ON ni.NodeId = npv2.NodeId
		inner join medianamik_Node n
		ON n.NodeId = npv2.NodeId
		AND n.TypeId = @TypeId
		AND n.IsDeleted = 0
		WHERE npv2.PropertyId = @PropertyID
		AND ISNULL(npv2.Revision, dbo.fn_medianamik_MaxRevision()) <= ISNULL(@Revision, dbo.fn_medianamik_MaxRevision())
		GROUP BY npv2.NodeId, npv2.Value)
SELECT npv.NodeId, r.c As [Count]
FROM medianamik_nodePropertyValue npv
INNER JOIN Revisions r
	ON r.NodeId = npv.NodeId
		AND ISNULL(r.Revision, dbo.fn_medianamik_MaxRevision()) = ISNULL(npv.Revision, dbo.fn_medianamik_MaxRevision()) 
WHERE npv.PropertyId = @propertyID
AND r.RowNumber BETWEEN @FirstRow AND @LastRow
GROUP BY npv.NodeId, npv.Value, r.c
ORDER BY npv.Value
END');
GRANT EXECUTE ON [dbo].[medianamik_GetPagedNodesByType] TO [Medianamik_DataAccess]
END

--- ListTypeSelectorWindow.aspx
IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-06-02 14:06:20.103'             ,''             ,'2009-06-02 14:06:20.103'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.3F590203-AAB0-4B84-AC2C-78BB9D831262.'             ,         1             ,         0             ,'2009-06-02 14:06:20.103'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('532B0783-759A-4F84-81CA-B2B4B3A0183F'             ,'3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,         1             ,'2009-06-02 14:06:20.103'             ,'fr-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('D5297AC5-9861-490F-A551-E9C22097E8D5'             ,'3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,         1             ,'2009-06-02 14:06:20.103'             ,'en-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,'796a2401-7be9-44fa-b079-848e90afe0e7'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,NULL                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'/ModalWindows/ListTypeSelectorWindow.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Sélection de type pour liste'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '3F590203-AAB0-4B84-AC2C-78BB9D831262' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('3F590203-AAB0-4B84-AC2C-78BB9D831262'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Type selection for list'                       ,null             ,'en-CA'             ,null             )  END
--- ListList.aspx
IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-05-26 13:49:14.930'             ,''             ,'2009-05-26 13:49:14.930'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.2E57251E-91F2-4EDF-BCA5-E0D923413642.'             ,         1             ,        47             ,'2009-05-26 13:49:14.930'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('482EE3EE-DC29-4866-9993-248D260B61D7'             ,'2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,         1             ,'2009-05-26 13:49:14.930'             ,'fr-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('2F0DDBC3-EB5B-4743-862C-29A5E9CADF01'             ,'2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,         1             ,'2009-05-26 13:49:14.930'             ,'en-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,'796a2401-7be9-44fa-b079-848e90afe0e7'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,'f091e77f-76db-421b-87ab-8ad4c2155175'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'ListList.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Gestion de listes'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '2E57251E-91F2-4EDF-BCA5-E0D923413642' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('2E57251E-91F2-4EDF-BCA5-E0D923413642'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'List management'                       ,null             ,'en-CA'             ,null             )  END
--- ListManagement.aspx
IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-05-29 13:43:19.117'             ,''             ,'2009-05-29 13:43:19.117'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.588522FC-1753-440A-88E2-25BAFEB54BF8.'             ,         1             ,         0             ,'2009-05-29 13:43:19.117'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('F10E7A17-EF90-4D3E-9618-25182010A9DA'             ,'588522FC-1753-440A-88E2-25BAFEB54BF8'             ,         1             ,'2009-05-29 13:43:19.117'             ,'fr-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('D2EA299E-94A5-4CCC-8AB0-55F32E313EBB'             ,'588522FC-1753-440A-88E2-25BAFEB54BF8'             ,         1             ,'2009-05-29 13:43:19.117'             ,'en-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,'796a2401-7be9-44fa-b079-848e90afe0e7'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,'f091e77f-76db-421b-87ab-8ad4c2155175'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'ListManagement.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Gestion d''un élément listable'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '588522FC-1753-440A-88E2-25BAFEB54BF8' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('588522FC-1753-440A-88E2-25BAFEB54BF8'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Listable element management'                       ,null             ,'en-CA'             ,null             )  END

-- Publication
IF NOT EXISTS (SELECT NULL FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[medianamik_GetShownInPublishingNode]') AND type in (N'P', N'PC'))
BEGIN
EXEC('CREATE PROCEDURE [dbo].[medianamik_GetShownInPublishingNode]
	@BaseNodeIds VARCHAR(MAX),
	@BaseNodeTypeId UNIQUEIDENTIFIER,
	@Culture VARCHAR(10)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	DECLARE @BaseNodeTypePath AS VARCHAR(500)
	DECLARE @NodeIds AS TABLE(NodeId UNIQUEIDENTIFIER)
	DECLARE @ParentNodes AS TABLE([Path] VARCHAR(500))
	
	SELECT @BaseNodeTypePath = [Path] FROM medianamik_Type WHERE TypeId = @BaseNodeTypeId
	
	INSERT INTO @NodeIds(NodeId)
	SELECT * FROM Split(@BaseNodeIds,'','')

	INSERT INTO @ParentNodes([Path])
	SELECT [Path] FROM medianamik_Node n
	INNER JOIN @NodeIds t
	ON n.NodeId = t.NodeId

	SELECT n.NodeId FROM medianamik_Node n
	INNER JOIN @ParentNodes p
	ON n.[Path] LIKE p.[Path] + ''%''
	INNER JOIN medianamik_Type t
	ON n.TypeId = t.TypeId
	AND t.[Path] LIKE @BaseNodeTypePath + ''%''
	AND t.IsVersioned = 1
	AND t.IsSystem = 0
	INNER JOIN medianamik_NodeInstance i
	ON i.NodeId = n.NodeId
	AND i.CultureName = @Culture
	INNER JOIN medianamik_NodePropertyValue v
	ON v.NodeId = n.NodeId
	AND v.CultureName IN (@Culture, '''')
	AND v.Revision IS NULL
	GROUP BY n.NodeId
END')
GRANT EXECUTE ON [dbo].[medianamik_GetShownInPublishingNode] TO [Medianamik_DataAccess]
END

IF NOT EXISTS( SELECT NULL FROM medianamik_Property where PropertyId = '19AE84AF-386F-41D9-ACD3-82EBB313A28F' )  BEGIN  INSERT INTO [dbo].[medianamik_Property]             ([PropertyId]             ,[TypeId]             ,[Name]             ,[HaveTooltip]             ,[IsLanguageNeutral]             ,[IsRequired]             ,[IsUnique]             ,[ValidationRegex]             ,[GroupName]             ,[Flags]             ,[MedianamikControlId]             ,[MedianamikControlWidth]             ,[MedianamikControlHeight]             ,[Position]             ,[PrimaryPropertyId]             ,[PrimaryTypeId]             ,[PrimaryMedianamikControlId]             ,[PrimaryMedianamikControlWidth]             ,[PrimaryMedianamikControlHeight]             ,[Roles]             ,[MaxLength]             ,[MinLength]             ,[DataTypeId]             ,[PrimaryDataTypeId]             ,[Description]             ,[TreeRootNodeId]             , [PrimaryTreeRootNodeId])       VALUES             ('19AE84AF-386F-41D9-ACD3-82EBB313A28F'             ,'627E47FC-6C91-444F-B3A6-79B1F687EF9A'     , 'ShowInPublishing'     ,         0     ,         1     ,         0     ,         0     ,NULL     ,''     ,         0     ,'09BBED40-5BEB-434F-ABB2-4F46FB29B86E'     ,null     ,null     ,         0     ,NULL     ,NULL     ,NULL     ,null     ,null     ,''     ,NULL     ,NULL     ,'E7293D5E-0B55-4FF1-A24A-B4969B187A19'     ,'0D5B7A19-A12A-46B5-9A2C-8D15093F5666'     ,'Afficher les éléments de ce module dans le module de publication'     ,NULL              ,NULL             )  END
UPDATE medianamik_NodePropertyValue SET Value = 'True' WHERE NodeId = 'f091e77f-76db-421b-87ab-8ad4c2155175' AND PropertyId = '19ae84af-386f-41d9-acd3-82ebb313a28f'


-- Ajout WebSiteProxy
IF NOT EXISTS( SELECT NULL  FROM medianamik_Type where TypeId = 'AF4D27EB-5245-41DC-AA1C-DFA0B7D9C899')  BEGIN  INSERT INTO [dbo].[medianamik_Type]             ([TypeId]             ,[ParentTypeId]             ,[Name]             ,[CanHaveChilds]             ,[IsGenerated]             ,[IsManyToMany]             ,[Path]             ,[Depth]             ,[Roles]             ,[Flags]             ,[Description]             ,[ExtendedProperties]             ,[IsSystem]             ,[IsAbstract])       VALUES             ('AF4D27EB-5245-41DC-AA1C-DFA0B7D9C899'             ,'30BA97AB-C437-4C85-8D9D-77FB428D3D16'             ,'WebSiteProxy'             ,         0             ,         0             ,         0             ,'.30BA97AB-C437-4C85-8D9D-77FB428D3D16.AF4D27EB-5245-41DC-AA1C-DFA0B7D9C899.'             ,         1     ,NULL     ,         0             ,''     ,'<ExtendedProperties><Icon/></ExtendedProperties>'            ,         0     ,         0             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_Property where PropertyId = '6A53B62B-0A12-4B99-9DA0-21F7D22D45B2' )  BEGIN  INSERT INTO [dbo].[medianamik_Property]             ([PropertyId]             ,[TypeId]             ,[Name]             ,[HaveTooltip]             ,[IsLanguageNeutral]             ,[IsRequired]             ,[IsUnique]             ,[ValidationRegex]             ,[GroupName]             ,[Flags]             ,[MedianamikControlId]             ,[MedianamikControlWidth]             ,[MedianamikControlHeight]             ,[Position]             ,[PrimaryPropertyId]             ,[PrimaryTypeId]             ,[PrimaryMedianamikControlId]             ,[PrimaryMedianamikControlWidth]             ,[PrimaryMedianamikControlHeight]             ,[Roles]             ,[MaxLength]             ,[MinLength]             ,[DataTypeId]             ,[PrimaryDataTypeId]             ,[Description]             ,[TreeRootNodeId]             , [PrimaryTreeRootNodeId])       VALUES             ('6A53B62B-0A12-4B99-9DA0-21F7D22D45B2'             ,'AF4D27EB-5245-41DC-AA1C-DFA0B7D9C899'     , 'WebSite'     ,         0     ,         1     ,         1     ,         0     ,NULL     ,''     ,         0     ,'59B66D0C-8BFF-4802-B83A-977E11797677'     ,'300px'     ,null     ,         0     ,'35A3F17A-A4C8-4331-9E8F-10FC27C18445'     ,'44EB974B-6871-4879-A0C9-C596B42FF945'     ,NULL     ,null     ,null     ,''     ,NULL     ,NULL     ,'0D5B7A19-A12A-46B5-9A2C-8D15093F5666'     ,'0D5B7A19-A12A-46B5-9A2C-8D15093F5666'     ,''     ,NULL              ,NULL             )  END

-- Gestion des interfaces
IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-06-08 13:31:15.317'             ,''             ,'2009-06-08 13:31:15.317'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440.'             ,         1             ,         0             ,'2009-06-08 13:31:15.317'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('598DC163-F611-46D4-B121-930BEE0E822E'             ,'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,         1             ,'2009-06-08 13:31:15.317'             ,'en-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('1E1A7AEF-F097-4B81-BCB2-D2FF87BB7A26'             ,'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,         1             ,'2009-06-08 13:31:15.317'             ,'fr-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,NULL                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,NULL                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'modalwindows/validateinterfacewindow.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Propriétés de l''interface'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('EC94BEAB-F2B7-4BE4-A8FA-8E0A9B140440'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Interface Properties'                       ,null             ,'en-CA'             ,null             )  END

IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-06-04 14:29:17.000'             ,''             ,'2009-06-04 14:29:17.000'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.1A5E44D4-456F-432B-86D2-08171EA733EF.'             ,         1             ,         0             ,'2009-06-04 14:29:17.000'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('05BCA0E1-8003-4FB0-8BE6-26B14E8572B1'             ,'1A5E44D4-456F-432B-86D2-08171EA733EF'             ,         1             ,'2009-06-04 14:29:17.000'             ,'en-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('66FC5188-2152-4391-91DF-FD086BF2DD30'             ,'1A5E44D4-456F-432B-86D2-08171EA733EF'             ,         1             ,'2009-06-04 14:29:17.000'             ,'fr-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,'aeea5def-8fcc-40b7-b511-3979edff945c'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,'6272f569-4d7b-4903-bfb8-8a61d16cf79b'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'interfacepropertymanagement.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Créer / Éditer une propriété d''une interface'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '1A5E44D4-456F-432B-86D2-08171EA733EF' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('1A5E44D4-456F-432B-86D2-08171EA733EF'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Create / Edit Type Property'                       ,null             ,'en-CA'             ,null             )  END

IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-06-04 14:19:10.590'             ,''             ,'2009-06-04 14:19:10.590'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.21E91CE1-68D3-4BF1-B480-8493FEC255CA.'             ,         1             ,         0             ,'2009-06-04 14:19:10.590'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('4BE45CA2-C704-4E29-B9AC-35E7D7A49A12'             ,'21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,         1             ,'2009-06-04 14:19:10.590'             ,'fr-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('E46AB5F1-197D-4709-850C-7803A0010FDB'             ,'21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,         1             ,'2009-06-04 14:19:10.590'             ,'en-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,'aeea5def-8fcc-40b7-b511-3979edff945c'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,'6272f569-4d7b-4903-bfb8-8a61d16cf79b'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'interfacepropertylist.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Gestion des propriétés d''une interface'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '21E91CE1-68D3-4BF1-B480-8493FEC255CA' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('21E91CE1-68D3-4BF1-B480-8493FEC255CA'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Interface Property Management'                       ,null             ,'en-CA'             ,null             )  END

IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-06-03 13:30:46.540'             ,''             ,'2009-06-03 13:30:46.540'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.50205440-2384-4640-97FF-EE0315C6C14C.'             ,         1             ,         0             ,'2009-06-03 13:30:46.540'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('3FC89665-7842-4B55-989A-33068D4D46AD'             ,'50205440-2384-4640-97FF-EE0315C6C14C'             ,         1             ,'2009-06-03 13:30:46.557'             ,'fr-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('7580E060-F77B-4D5C-931D-8EC3FDD88251'             ,'50205440-2384-4640-97FF-EE0315C6C14C'             ,         1             ,'2009-06-03 13:30:46.557'             ,'en-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,'aeea5def-8fcc-40b7-b511-3979edff945c'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,'6272f569-4d7b-4903-bfb8-8a61d16cf79b'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'interfacemanagement.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Créer / Éditer une interface'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = '50205440-2384-4640-97FF-EE0315C6C14C' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('50205440-2384-4640-97FF-EE0315C6C14C'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Create / Edit Interface'                       ,null             ,'en-CA'             ,null             )  END

IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[EditedOn]             ,[EditedBy])       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'                        ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-05-29 09:26:07.923'             ,''             ,'2009-05-29 09:26:07.923'             ,''             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2.'             ,         1             ,         0             ,'2009-05-29 09:26:07.923'             ,'sa'             )  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('92648782-F302-4936-8770-B1B63D103DCF'             ,'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,         1             ,'2009-05-29 09:26:07.923'             ,'fr-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CultureName])       VALUES             ('F42FF816-FC29-4DF7-AB4F-BAB0AB6DCE23'             ,'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,         1             ,'2009-05-29 09:26:07.923'             ,'en-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,'aeea5def-8fcc-40b7-b511-3979edff945c'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,'6272f569-4d7b-4903-bfb8-8a61d16cf79b'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'False'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'interfacelist.aspx'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'True'                       ,null             ,''             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Gestion des interfaces'                       ,null             ,'fr-CA'             ,null             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodeId]             ,[PropertyId]             ,[Value]             ,[Revision]             ,[CultureName]             ,[EndRevision]             )       VALUES             ('DABBDC61-9077-4FE2-B6A5-BB0489D3C7C2'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Interfaces Management'                       ,null             ,'en-CA'             ,null             )  END

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[medianamik_Interface]') AND type in (N'U'))
BEGIN
	CREATE TABLE [dbo].[medianamik_Interface](
		[InterfaceId] [uniqueidentifier] NOT NULL,
		[Name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL,
		[Description] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AI NULL,
	 CONSTRAINT [PK_medianamik_Interface] PRIMARY KEY CLUSTERED 
	(
		[InterfaceId] ASC
	)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
	) ON [PRIMARY]
END

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[medianamik_TypeInterface]') AND type in (N'U'))
BEGIN
	CREATE TABLE [dbo].[medianamik_TypeInterface](
		[TypeId] [uniqueidentifier] NOT NULL,
		[InterfaceId] [uniqueidentifier] NOT NULL,
		[Id] [uniqueidentifier] NOT NULL,
	 CONSTRAINT [PK_medianamik_TypeInterface] PRIMARY KEY CLUSTERED 
	(
		[Id] ASC
	)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
	) ON [PRIMARY]

	ALTER TABLE [dbo].[medianamik_TypeInterface]  WITH CHECK ADD  CONSTRAINT [FK_medianamik_TypeInterface_medianamik_Interface] FOREIGN KEY([InterfaceId])
	REFERENCES [dbo].[medianamik_Interface] ([InterfaceId])
	ON DELETE CASCADE

	ALTER TABLE [dbo].[medianamik_TypeInterface]  WITH CHECK ADD  CONSTRAINT [FK_medianamik_TypeInterface_medianamik_Type] FOREIGN KEY([TypeId])
	REFERENCES [dbo].[medianamik_Type] ([TypeId])
	ON DELETE CASCADE
END

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[medianamik_InterfaceProperty]') AND type in (N'U'))
BEGIN
	CREATE TABLE [dbo].[medianamik_InterfaceProperty](
		[InterfacePropertyId] [uniqueidentifier] NOT NULL,
		[InterfaceId] [uniqueidentifier] NOT NULL,
		[DataTypeId] [uniqueidentifier] NOT NULL,
		[Name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL,
		[Description] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AI NULL,
		[MaxLength] [smallint] NULL,
		[PrimaryTypeId] [uniqueidentifier] NULL,
	 CONSTRAINT [PK_medianamik_InterfaceProperty] PRIMARY KEY CLUSTERED 
	(
		[InterfacePropertyId] ASC
	)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
	) ON [PRIMARY]

	ALTER TABLE [dbo].[medianamik_InterfaceProperty]  WITH CHECK ADD  CONSTRAINT [FK_medianamik_InterfaceProperty_medianamik_DataType] FOREIGN KEY([DataTypeId])
	REFERENCES [dbo].[medianamik_DataType] ([DataTypeID])
	
	ALTER TABLE [dbo].[medianamik_InterfaceProperty]  WITH CHECK ADD  CONSTRAINT [FK_medianamik_InterfaceProperty_medianamik_Interface] FOREIGN KEY([InterfaceId])
	REFERENCES [dbo].[medianamik_Interface] ([InterfaceId])
	ON DELETE CASCADE

	ALTER TABLE [dbo].[medianamik_InterfaceProperty]  WITH CHECK ADD  CONSTRAINT [FK_medianamik_InterfaceProperty_medianamik_InterfaceProperty] FOREIGN KEY([InterfacePropertyId])
	REFERENCES [dbo].[medianamik_InterfaceProperty] ([InterfacePropertyId])
	
	ALTER TABLE [dbo].[medianamik_InterfaceProperty]  WITH CHECK ADD  CONSTRAINT [FK_medianamik_InterfaceProperty_medianamik_Type] FOREIGN KEY([PrimaryTypeId])
	REFERENCES [dbo].[medianamik_Type] ([TypeId])
END

